﻿using Abp;
using Abp.Application.Services;
using Abp.AspNetCore.Mvc.Authorization;
using AbpZeroTemplate.DemoUiComponents;
using AbpZeroTemplate.Web.Controllers;
using AbpZeroTemplate.Web.Swagger;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbpZeroTemplate.Api.Admin.Controllers
{
    /// <summary>帐号相关
    /// </summary>
    [Area("Admin")]
    [Route("Admin/DemoUiComponents/[action]")]
    [ApiName("Admin")]
    [RemoteService]
    [AbpMvcAuthorize]
    public class DemoUiComponentsController : AbpZeroTemplateControllerBase
    {
        private readonly IDemoUiComponentsAppService _demoUiComponentsAppService;

        public DemoUiComponentsController(IDemoUiComponentsAppService demoUiComponentsAppService)
        {
            _demoUiComponentsAppService = demoUiComponentsAppService;
        }

        [HttpGet]
        public List<NameValue<string>> GetCountries(string searchTerm)
        {
            return _demoUiComponentsAppService.GetCountries(searchTerm);
        }

        [HttpPost]
        public List<NameValue<string>> SendAndGetSelectedCountries(List<NameValue<string>> selectedCountries)
        {
            return _demoUiComponentsAppService.SendAndGetSelectedCountries(selectedCountries);
        }

    }
}
